<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>重叠</title>
		<style>
			.container{
				width: 10em;
				height: 10em;
				display: flex;
				position: relative;
				align-items: center;
				justify-content: center;
				border-radius: 1em;
			}
			.container:nth-child(2){
				top: -6em;
				left: 4em;
			}
			.sub{
				width: 7em;
				height: 7em;
				border-radius: 0.5em;
			}
			.container:nth-child(1){
				background-color: lightgreen;
				z-index: 2;
			}
			.container:nth-child(2){
				background-color: moccasin;
				z-index: 1;
			}
			.container:nth-child(1) .sub{
				background-color: green;
				z-index: 3;
			}
			.container:nth-child(2) .sub{
				background-color: orange;
				z-index: 4;
			}
		</style>
	</head>
	<body>
		<figure>
			<div class="container">
				<div class="sub"></div>
			</div>
			<div class="container">
				<div class="sub"></div>
			</div>
		</figure>
	</body>
</html>
